<template>
  <div>
    <div class="datails-top">
      <span class="text">消费名称：</span>
      <el-input
        style="width: 300px"
        v-model="from.name"
        placeholder="请输入消费名称"
      />
    </div>
    <div>
      <TinyMce
        ref="Timymces"
        id="timymces"
        :height="500"
        :context="from.meun"
        placeholder="输入内容"
      ></TinyMce>
    </div>
    <div class="adder">
      <div></div>
      <el-button type="primary" @click="addBtn">提交</el-button>
    </div>
  </div>
</template>

<script>
import TinyMce from "@/components/tinymce/TinyMce.vue";
export default {
  name: "ConsunmptionDetails",
  components: {
    TinyMce,
  },
  data() {
    return {
      from: {
        name: "买包子",
         meun: "吃早餐，哈哈哈哈哈哈哈哈哈哈！！！！！！",
      },
     
    };
  },
  created() {
    if(this.$route.params.item){
      this.from=JSON.parse(this.$route.params.item)
    }
  },
  methods: {
    addBtn() {
      this.from.meun = this.$refs.Timymces.tinymceHtml;
      alert(this.from.meun);
    },
  },
};
</script>

<style lang="less" scoped>
.datails-top {
  height: 80px;
  display: flex;
  align-items: center;
  background-color: #fff;
  color: #666;
  margin-bottom: 20px;
  .text {
    width: 90px;
    margin-left: 20px;
  }
}
.adder{
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
</style>